<template>
  <div class="dashboard-editor-container">
    <PanelGroup />
    <el-row :gutter="32">
      <el-col :xs="36" :sm="36" :lg="12">
        <div class="chart-wrapper">
          <bar-chart />
        </div>
      </el-col>
      <el-col :xs="36" :sm="36" :lg="12">
        <div class="chart-wrapper">
          <raddar-chart />
        </div>
      </el-col>
    </el-row>
    <el-row :gutter="8">
      <el-col
        :xs="{span: 24}"
        :sm="{span: 24}"
        :md="{span: 24}"
        :lg="{span: 12}"
        :xl="{span: 12}"
        style="padding-right:8px;margin-bottom:30px;"
      >
        <transaction-table />
      </el-col>
      <el-col
        :xs="{span: 24}"
        :sm="{span: 24}"
        :md="{span: 24}"
        :lg="{span: 12}"
        :xl="{span: 12}"
        style="padding-right:8px;margin-bottom:30px;"
      >
        <el-card class="box-card">
          <el-tabs v-model="activeName1">
            <el-tab-pane label="商机热度" name="first">
              <el-table :data="tableData2" style="width: 100%">
                <el-table-column type="index" width="50" />
                <el-table-column prop="tittle" show-overflow-tooltip label="标题" />
                <el-table-column prop="numberViews" label="点击率" width="180" />
              </el-table>
            </el-tab-pane>
          </el-tabs>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import PanelGroup from './components/PanelGroup'
import RaddarChart from './components/RaddarChart'
import BarChart from './components/BarChart'
import TransactionTable from './components/TransactionTable'
import axios from 'axios'
export default {
  name: 'DashboardAdmin',
  components: {
    PanelGroup,
    RaddarChart,
    BarChart,
    TransactionTable
  },
  data() {
    return {
      activeName1: 'first',
      tableData2: []
    }
  },
  mounted() {
    this.initeGetTableData()
  },
  methods: {
    initeGetTableData() {
      axios
        .post('/manage/browseRecords/getHotBotDTO', {
          keyword: '',
          page: {
            maxResultCount: 0,
            pageNo: 0,
            pageSize: 10,
            skipCount: 0
          },
          type: 0
        })
        .then(res1 => {
          console.log(res1)
          this.tableData2 = res1.data.data.items.items
        })
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .github-corner {
    position: absolute;
    top: 0px;
    border: 0;
    right: 0;
  }

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width: 1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
